//package main
//import "fmt"
//type Person struct{
//	name string
//	age int
//}
//var p Person = Person{"alex",18}
//func doSomething()Person {
//	return p
//}
//func main(){
//	data := doSomething()
//	p.name = "JACK"
//	fmt.Println(data) //{alex 18}
//	fmt.Println(p)	//{JACK 18}
//}

//package main
//import "fmt"
//
////声明类型
//type MyInt int
//
////为MyInt类型指定一个指针方法
//func (i *MyInt) DoSomething(a1 int,a2 int) int {
//	return a1+a2+int(*i	)
//}
//
//func do(a1 int,a2 int)int{
//	return a1+a2
//}
//
//func main(){
//	var v1 MyInt = 1
//	result := v1.DoSomething(1,2)
//	fmt.Println(result)
//}

//package main
//import "fmt"
//type Person struct{
//	name string
//	age int
//	blog string
//}
//
//func (p *Person) DoSomething(a1 int,a2 int) int {
//	return a1+a2+p.age
//}
//func main(){
//	p1 := Person{name:"alex",age:18,blog:"123"}
//	result := p1.DoSomething(1,2)
//	fmt.Println(result)
//}
package main
import "fmt"
type Base struct{
	name string
}
type Son struct{
	Base
	age int
}
func(b *Base) m1()int{
	return 666
}
func(s *Son) m2()int{
	return 999
}
func main(){
	son := Son{age:18,Base:Base{name:"alex"}}
	result1 := son.m1()
	result2 := son.m2()
	fmt.Println(result1,result2)//666 999
}